<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
		<title>Add Project Information</title>
		
		<link rel="stylesheet" href="CssFiles/MyCssStyle.css" >
		
		<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js"></script>
		<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
		
		<script type="text/javascript">
			
			$(document).ready(function(){
				
					
					/* $("#formAddProject").submit(function(e){
						e.preventDefault();
					}); */
				
				
					$("#btnAdd").click(function(e){
						var isOk=true;
						
						dataString=$("#formAddProject").serialize();
						
						var prjTitle=$("input#projectTitle").val();
						var prjOwner=$("input#projectOwner").val();
						var prjLocation=$("input#projectLocation").val();
						
						//alert(prjTitle+"  "+prjOwner+"  "+prjLocation );
						
						dataString="projectTitle="+prjTitle+"&projectOwner="+prjOwner+"&projectLocation="+prjLocation;
						
						$.ajax({
							type:"POST",
							url:"AddProject",
							data:dataString,
							dataType:"json",
							
							success:function(data,textStatus,jqXHR){
								
								if(data.success){
									$("#statusText").html("");
									$("#statusText").append(data.statusText);
									
									$("input:text#projectTitle").val("");
									$("input:text#projectOwner").val("");
									$("input:text#projectLocation").val("");
								}else{
									$("#statusText").html("");
									$("#statusText").append(data.statusText);
									
								}
								
							},
							
							error:function(){
							
							}
						
						});
					
					});
			
				
				
			});
			
			
			
		</script>
		
	</head>
	<body>
	
		<%-- <div style="width: 100%;">
			<%
				request.getRequestDispatcher("Menu.jsp").include(request, response);
			 %>
		</div> --%>
		 <!-- action="AddProject" method="post" -->
	
		<form  id="formAddProject" >
			
			<fieldset style="width: 75%;  "   >
				<legend><b>Project Details</b></legend>
				
				<table>
					<tr>
						<td  ><b>Project Title</b></td>
						<td><input type="text" class="txtbox" id="projectTitle" name="projectTitle" value=""></input>	</td>
					</tr>
					<tr>
						<td><b>Project Owner</b></td>
						<td><input type="text" class="txtbox" id="projectOwner" name="projectOwner" value=""></input></td>
					</tr>
					<tr>
						<td><b>Project Location</b></td>
						<td><input type="text" class="txtbox" id="projectLocation" name="projectLocation" value=""></input></td>
					</tr>
					<tr>
						<td><b>Project Location</b></td>
						<td>
							<select  name="dd" class="slctbox" >
								<option value="sdf">dff</option>
								<option value="sdf">sd</option>
								<option value="sdf">vcb</option>
								<option value="sdf">"bjh</option>
							</select>
						</td>
					</tr>
					<tr>
						<td></td>
						<td>  
							<input type="button" class="btn" name="btnAdd" id="btnAdd" value="Add"  />
						</td>
					</tr>
				</table>
				
			</fieldset>
			
			
		
		</form>
		<div id="statusText">
		
		</div>
	
	</body>
</html>